<template>
  <div>
    <el-breadcrumb separator="/" style="margin-top: 20px">
      <el-breadcrumb-item :to="{ path: '/manager/order/tackOut' }"
        >首页</el-breadcrumb-item
      >
      <el-breadcrumb-item :to="{ path: '/manager/feedback/personal' }"
        >个人反馈</el-breadcrumb-item
      >
    </el-breadcrumb>
    <el-table :data="tableData" height="75vh" style="width: 100%">
      <el-table-column prop="content" label="反馈内容" width="280" />
      <el-table-column prop="inputTime" label="反馈时间" width="180" />
      <el-table-column label="反馈状态" width="180">
        <template #default="scope">
          {{
            scope.row.state == 1 ? "待反馈" : (scope.row.state = 2 ? "已反馈" : "error")
          }}
        </template>
      </el-table-column>
      <el-table-column label="反馈时间" width="180" prop="updateTime" />
      <el-table-column prop="feedbackContent" label="反馈内容" width="280" />
    </el-table>
  </div>
</template>

<script lang="ts" setup>
import axios from "axios";
import { ref } from "vue";

const tableData = ref([]);
const token = localStorage.getItem("student_auth_token");
const getData = () => {
  axios
    .get("/api/feedback/select", {
      headers: {
        token: token,
      },
    })
    .then((res) => {
      // console.log("code line-20 \n\r😒 res:\n\r", res);
      tableData.value = res.data.message;
    })
    .catch((err) => {
      console.log("code line-25 \n\r😀 err:\n\r", err);
    });
};
getData();
setInterval(getData, 2000);
</script>
